﻿using System;
using System.IO;

namespace CometDocs
{
    public interface IClient
    {
        AuthenticationToken Authenticate(string username, string password, string key, int? validity = null);
        FileInfo ConvertFile(AuthenticationToken token, FileInfo file, ConversionType conversionType, TimeSpan? timeout = null);
        void CreateAccount(string name, string email, string password);
        FolderInfo CreateFolder(AuthenticationToken token, FolderInfo parent, String name);
        void DeleteFile(AuthenticationToken token, FileInfo file, bool? deleteRevisions = null);
        void DeleteFolder(AuthenticationToken token, FolderInfo folder);
        File DownloadFile(AuthenticationToken token, FileInfo file);
        Category[] GetCategories();
        Conversion[] GetConversions(AuthenticationToken token, FileInfo file = null);
        ConversionStatus GetConversionStatus(AuthenticationToken token, FileInfo file, ConversionType conversion);
        ConversionType[] GetConversionTypes();
        Folder GetFolder(AuthenticationToken token, FolderInfo folder = null, bool? recursive = null);
        string[] GetMethods();
        Notification[] GetNotifications(AuthenticationToken token);
        FileInfo[] GetPublicFiles(AuthenticationToken token, Category category = null);
        FileInfo[] GetSharedFiles(AuthenticationToken token);
        void InvalidateToken(AuthenticationToken token);
        void RefreshToken(AuthenticationToken token, int? validity = null);
        void SendFile(AuthenticationToken token, FileInfo file, string[] recipients, string sender = null, string message = null);
        FileInfo UploadFile(AuthenticationToken token, Stream file, string name, long? folderId = null);
        FileInfo UploadFile(AuthenticationToken token, Stream file, string name, FolderInfo folder);
        FileInfo UploadFile(AuthenticationToken token, Stream file, FolderInfo folder);
        FileInfo UploadFile(AuthenticationToken token, string file, long? folderId = null);
        FileInfo UploadFile(AuthenticationToken token, File file, long? folderId = null);
        FileInfo UploadFile(AuthenticationToken token, File file, FolderInfo folder);
        FileInfo UploadFileFromUrl(AuthenticationToken token, string url, string name = null, long? folderId = null);
        FileInfo UploadFileFromUrl(AuthenticationToken token, string url, FolderInfo folder);
    }
}
